<?php

namespace Stolium\TestBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class TrainingType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('time','time',array('label'=>'Время'))
            ->add('price','text',array('label'=>'Цена'))
            ->add('location','textarea', array('label'=>'Место'))
            ->add('club','entity',  array(
		        'class' => 'TestBundle:Club',
		        'property' => 'name')
		        ,array('label'=>'Группа')
	        )
        ;
    }
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'Stolium\TestBundle\Entity\Training'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'stolium_testbundle_training';
    }
}
